<template>
	<view class="detail">
		<!-- 轮播图 -->
		<swiper class="swiper" circular indicator-dots autoplay="true" interval="5000" duration="1000">
			<swiper-item v-for="(item,index) in bannerList" :key="index" class="swiper-item">
				<image :src="item.pics_mid_url" mode="" class="img"></image>
			</swiper-item>			
	 </swiper>
		
	</view>
</template>

<script>
	import {getGoodsDetail} from '@/utils/api.js'
	
	export default {
		data() {
			return {
				detail:{},//存放接口请求过来的数据
				bannerList:[],//存放轮播图
			};
		},
		onLoad(options) {
			
			console.log(options);
			// 请求接口
			getGoodsDetail({goods_id:options.id}).then(res=>{
				console.log(res);
				this.detail = res
				this.bannerList = res.pics
				
			})
			
		},
		methods:{
	
		}
	}
</script>

<style lang="scss">
	.swiper{
		width: 100%;
		height: 400rpx;
		.swiper-item{
			width: 100%;
			height: 400rpx;
			.img{
				width: 100%;
				height: 400rpx;
			}
		}
	}

</style>
